package com.douqu.game.core.entity.ext.data.major;

import com.douqu.game.core.config.talent.TalentUpConfig;
import com.douqu.game.core.entity.EntityObject;
import com.douqu.game.core.factory.DataFactory;

import java.util.List;

/**
 * Created by dengbo on 2018/10/15 0015.
 */
public class TalentBean extends EntityObject {

    //天赋组id
    private int talentId;

    //加点等级
    private int level;

    //精炼等级
    private int refineLevel;


    public TalentBean(int talentId,int level,int refineLevel){
        this.talentId =talentId;
        this.level= level;
        this.refineLevel =refineLevel;
    }

    public int getTalentId() {
        return talentId;
    }

    public void setTalentId(int talentId) {
        this.talentId = talentId;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public int getRefineLevel() {
        return refineLevel;
    }

    public void setRefineLevel(int refineLevel) {
        this.refineLevel = refineLevel;
    }

    public TalentUpConfig getConfig()
    {
        for(List<TalentUpConfig> list : DataFactory.getInstance().getTalentUpMap().values())
        {
            for(TalentUpConfig talentUpConfig : list)
            {
                if(talentUpConfig.talentId == talentId && talentUpConfig.level == level)
                    return talentUpConfig;
            }
        }
        return null;
    }
}
